{% extends 'layout.html' %}


{% block content %}
    {% load my_tags %}

    <div>
        <a class="btn btn-primary" href="{% reverse_url request 'add_course_record' class_id %}">添加</a>
    </div>

    <form action="" class="form-inline pull-right">
        <input type="text" name="query" class="form-control">
        <button class="btn btn-sm btn-primary">搜索</button>
    </form>

    <form action="" method="post" class="form-inline">
        {% csrf_token %}
        <select name="action" id="" class="form-control">
            <option value="multi_init">批量初始化学习记录</option>
        </select>
        <button class="btn btn-primary btn-sm">提交</button>

        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>选择</th>
                <th>序号</th>
                <th>名称</th>
                <th>日期</th>
                <th>课程标题</th>
                <th>课程内容</th>
                <th>是否有作业</th>
                <th>讲师</th>
                <th>记录者</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>

            {% for course_record in all_course_record %}
                <tr>
                    <td><input type="checkbox" name="ids" value="{{ course_record.pk }}"></td>
                    <td>{{ forloop.counter }}</td>
                    <td><a href="{% url 'study_record_list' course_record.pk %}">{{ course_record }}</a>  </td>
                    <td>{{ course_record.date }}</td>
                    <td>{{ course_record.course_title }}</td>
                    <td>{{ course_record.course_memo }}</td>
                    <td>{{ course_record.has_homework }}</td>
                    <td>{{ course_record.teacher }}</td>
                    <td>{{ course_record.recorder }}</td>
                    <td><a href="{% reverse_url request 'edit_course_record' course_record.pk  %}"> <i class="fa fa-edit"></i></a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

    </form>

    <nav aria-label="Page navigation">
        <ul class="pagination">
            {{ page_html|safe }}
        </ul>
    </nav>

{% endblock %}